#include <conio.h>
#include <stdio.h>
#include <stdlib.h>

void xuatMang(int*a, int n){
	for(int i = 0; i< n; i++){
		printf("\t %d",*(a+i));
	}
}
void doaMang(int*a, int n){
	int i = 0;
	int j = n-1;
	while(i <= j){
		int tmp = a[i];
		a[i] = a[j];
		a[j] = tmp;
		i++;
		j --;
	}
}

int main(){
	int *a;
	int n;
	printf("Nhap vao kich thuoc mang: ");
	scanf("%d",&n);
	a = (int*)calloc(n,sizeof(int));
	printf("\nNhap cac phan tu mang: \n");
	for(int i = 0; i < n ; i++){
		printf("A[%d]=",i);
		scanf("%d",a+i);
	}
	doaMang(a,n);
	printf("\n mang sau khi dao:\n ");
	xuatMang(a,n);
	getch();
}
